// https://leetcode.cn/problems/distribute-candies-to-people/
// Created by ade on 2022/10/31.
//

class Solution {
public:
    // 暴力法
    vector<int> distributeCandies1(int candies, int num_people) {
        vector<int> res(num_people);
        int i = 0;
        while (candies > 0) {
            res[i % num_people] += min(i + 1, candies);
            candies -= i + 1;
            i++;
        }
        return res;
    }
};